<script type="text/javascript">
	$(document).ready(function(){
		$("#page-add-form").validate({
			rules : {
				title : "required",
				desc : "required",
				content : "required",
			},
			messages : {
				title : "Hãy nhập tiêu đề",
				desc : "Hãy nhập tóm tắt",
				content : "Hãy nhập nội dung",
			},
			submitHandler: function(form) {
				var path = "ajax/page/add.php";
				var method = "POST";
				var data = $("#page-add-form").serialize();
				var content = CKEDITOR.instances.content.getData();
				data += "&content=" + encodeURIComponent(content);
				dashboard.admin.action.add("page-add-form", path, method, data, null);
			} 
		});
	});	
</script>
<div id="alert"></div>
<form class="form-horizontal" id="page-add-form" method="POST">	
	<fieldset>	
		<div class="control-group">
			<label class="control-label">Tiêu đề</label>
			<div class="controls">
				<input type="text" id="title" class="input-xlarge" value="" name="title" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">Mô tả</label>
			<div class="controls">
				<input type="text" id="desc" class="input-xlarge" value="" name="desc" />
			</div>
		</div>	
		<div class="control-group">
			<label class="control-label">Nội dung</label>
			<div class="controls">
				<textarea id="content" class="wysiwyg"   rows="15" cols="30"></textarea>						
			</div>
		</div>	
		<div class="form-actions">
			<button class="btn btn-primary" name="submit" value="submit" type="submit">Save changes</button>
			<a href="javascript:void(0)" onclick="javascript:history.go(-1);" class="btn">Cancel</a>
		</div>
	</fieldset>
</form>